<?php


namespace app\admin\validate;


use think\Validate;

class Category extends Validate
{
    protected $rule = [
        'id|主键ID' => 'require|number|gt:0',
        'cat_name|分类名称' => 'require|min:1|max:50|unique:category',
        'parent_id|所属分类ID' => 'require|number|egt:0',
        'type|显示在导航' => 'require|in:0,1'
    ];

    protected $scene = [
        'add' => ['cat_name', 'parent_id', 'type'],
        'edit' => ['id', 'cat_name', 'parent_id', 'type'],
    ];

}